//using Spine.Unity;
//using System.Collections;
//using UnityEngine;

//public class MoveFingerReminder : MonoBehaviour
//{
//	private ZoomAtBarController zoomAtBar;

//	private Canvas canvas;

//	private SkeletonGraphic spineAnimation;

//	private Vector3 startPosition;

//	private Vector3 currentPosition;

//	private bool fingerMoved;

//	private bool showingAnimation;

//	private bool isAnimationSet;

//	private void Awake()
//	{
//		zoomAtBar = GetComponent<ZoomAtBarController>();
//		StartCoroutine(CheckingForPermission());
//		CreateCanvasWithAnimation();
//	}

//	private void Update()
//	{
//		if (Input.GetMouseButtonDown(0))
//		{
//			startPosition = UnityEngine.Input.mousePosition;
//		}
//		if (Input.GetMouseButton(0))
//		{
//			currentPosition = UnityEngine.Input.mousePosition;
//			if (currentPosition.y < startPosition.y - 50f)
//			{
//				fingerMoved = true;
//				FadeOutSpineAnimation();
//			}
//		}
//	}

//	private IEnumerator CheckingForPermission()
//	{
//		WaitForSeconds waitTime = new WaitForSeconds(0.5f);
//		while (true)
//		{
//			CheckForPermissionToShowAnimation();
//			yield return waitTime;
//		}
//	}

//	private void CheckForPermissionToShowAnimation()
//	{
//		TutorialPanel x = UnityEngine.Object.FindObjectOfType<TutorialPanel>();
//		PausePanel x2 = UnityEngine.Object.FindObjectOfType<PausePanel>();
//		BottleController x3 = UnityEngine.Object.FindObjectOfType<BottleController>();
//		LosePanel x4 = UnityEngine.Object.FindObjectOfType<LosePanel>();
//		WinPanel x5 = UnityEngine.Object.FindObjectOfType<WinPanel>();
//		if (!fingerMoved && x == null && x2 == null && zoomAtBar.IsZoomAtBar() && !BottleController.blockAllBottlesController && x4 == null && x5 == null && x3 != null)
//		{
//			FadeInSpineAnimation();
//		}
//		else
//		{
//			FadeOutSpineAnimation();
//		}
//	}

//	private void CreateCanvasWithAnimation()
//	{
//		//GameObject gameObject = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/MoveFingerReminder/UI_MoveFingerReminder")) as GameObject;
//		//canvas = gameObject.GetComponent<Canvas>();
//		//spineAnimation = canvas.GetComponentInChildren<SkeletonGraphic>();
//		//ChangeSpineAnimationColor(0f);
//	}

//	private void FadeOutSpineAnimation()
//	{
//		if (showingAnimation)
//		{
//			showingAnimation = false;
//			Color color = spineAnimation.color;
//			float a = color.a;
//			iTween.ValueTo(base.gameObject, iTween.Hash("from", a, "to", 0f, "onupdate", "ChangeSpineAnimationColor", "time", 0.4f));
//		}
//	}

//	private void FadeInSpineAnimation()
//	{
//		if (!showingAnimation)
//		{
//			if (!isAnimationSet)
//			{
//				spineAnimation.AnimationState.SetAnimation(0, "4", loop: true);
//				isAnimationSet = true;
//			}
//			showingAnimation = true;
//			Color color = spineAnimation.color;
//			float a = color.a;
//			iTween.ValueTo(base.gameObject, iTween.Hash("from", a, "to", 1f, "onupdate", "ChangeSpineAnimationColor", "time", 0.3f));
//		}
//	}

//	public void ChangeSpineAnimationColor(float alpha)
//	{
//		Color color = spineAnimation.color;
//		color.a = alpha;
//		spineAnimation.color = color;
//	}

//	public void DestroyAnimation()
//	{
//		UnityEngine.Object.Destroy(canvas.gameObject);
//		UnityEngine.Object.Destroy(this);
//	}

//	public void ResetAnimation()
//	{
//		fingerMoved = false;
//	}
//}
